﻿<Page x:Class="JPGResizer.Pages.Page2"
      xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
      xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
      xmlns:localcontrols="clr-namespace:JPGResizer.Controls"
      xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
      xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
      mc:Ignorable="d" 
      d:DesignHeight="300" d:DesignWidth="400"
	Title="选择缩放的方式">

    <Grid>
        <GroupBox Header="选择缩放的方式">
            <StackPanel Margin="5" VerticalAlignment="Top" HorizontalAlignment="Left">
                <RadioButton Name="rbResizeType1" IsChecked="True">
                    <ToolTipService.ToolTip>
                        <ToolTip Content="默认缩放方式，将所有图片按其宽与所填宽度的比例进行缩放"/>
                    </ToolTipService.ToolTip>
                    <StackPanel Orientation="Horizontal" HorizontalAlignment="Left">
                        <TextBlock Text="请输入缩放后的图片的宽度：" Margin="2" VerticalAlignment="Center"/>
                        <localcontrols:NumbericTextBox x:Name="tbWith" MinWidth="25" MaxWidth="150" Margin="2" VerticalAlignment="Center"/>
                        <TextBlock Text="px" Margin="2" VerticalAlignment="Center"/>
                    </StackPanel>
                </RadioButton>
                <RadioButton Name="rbResizeType2">
                    <ToolTipService.ToolTip>
                        <ToolTip Content="将所有图片按其最长边与所填大小的比例进行缩放"/>
                    </ToolTipService.ToolTip>
                    <StackPanel Orientation="Horizontal" HorizontalAlignment="Left">
                        <TextBlock Text="请输入最长边缩放后的大小：" Margin="2" VerticalAlignment="Center"/>
                        <localcontrols:NumbericTextBox x:Name="tbLength" MinWidth="25" MaxWidth="150" Margin="2" VerticalAlignment="Center"/>
                        <TextBlock Text="px" Margin="2" VerticalAlignment="Center"/>
                    </StackPanel>
                </RadioButton>
                <RadioButton Name="rbResizeType3">
                    <ToolTipService.ToolTip>
                        <ToolTip Content="将所有图片按所选百分比进行缩放"/>
                    </ToolTipService.ToolTip>
                    <StackPanel Orientation="Horizontal" HorizontalAlignment="Left">
                        <TextBlock Text="请选择要缩放的百分比：" Margin="2" VerticalAlignment="Center"/>
                        <Slider Name="sliderResizePercent" Minimum="0" Maximum="100" Width="150" Margin="2" VerticalAlignment="Center" />
                        <localcontrols:NumbericTextBox x:Name="tbResizePercent" Width="35" Margin="0,2" VerticalAlignment="Center"/>
                        <TextBlock Text="%" Margin="2" VerticalAlignment="Center"/>
                    </StackPanel>
                </RadioButton>
                <RadioButton Name="rbResizeType4" IsEnabled="False">
                    <ToolTipService.ToolTip>
                        <ToolTip Content="最差选择，因为这样将可能会拉伸图片。比如原始图片是正方形，所填写的缩放结果为长方形，那么正方形的图片就会被拉伸为长方形"/>
                    </ToolTipService.ToolTip>
                    <StackPanel Orientation="Horizontal" HorizontalAlignment="Left">
                        <TextBlock Text="请输入自定义的宽和高：" Margin="2" VerticalAlignment="Center"/>
                        <TextBlock Text="宽：" Margin="2,2,0,2" VerticalAlignment="Center"/>
                        <localcontrols:NumbericTextBox Width="25" Margin="0,2" VerticalAlignment="Center"/>
                        <TextBlock Text="px ; " Margin="2" VerticalAlignment="Center"/>
                        <TextBlock Text="高：" Margin="2,2,0,2" VerticalAlignment="Center"/>
                        <localcontrols:NumbericTextBox Width="25" Margin="0,2" VerticalAlignment="Center"/>
                        <TextBlock Text="px" Margin="2" VerticalAlignment="Center"/>
                    </StackPanel>
                </RadioButton>
            </StackPanel>
        </GroupBox>
    </Grid>
</Page>
